package com.bykj.property.mapper.provider;

import com.bykj.property.controller.vo.request.PendingPaymentRecordPageRequest;
import com.bykj.property.controller.vo.request.PmProprietorPageRequest;
import org.apache.ibatis.jdbc.SQL;

/**
 * @author yiming
 * @title: PmProprietorSql
 * @projectName property
 * @description: TODO
 * @date 2019/6/3017:18
 */
public class PmProprietorSql {
    public String getSql(PmProprietorPageRequest pageRequest){
        return new SQL() {
            {
                SELECT("*");
                FROM("pm_proprietor");

                if(pageRequest.getPmVillageId()!=null) {

                    WHERE("pm_village_id = #{pmVillageId}");
                }
                if(pageRequest.getPmUnitId()!=null) {

                    WHERE("pm_unit_id = #{pmUnitId}");
                }
            }
        }.toString();

    }
}
